package com.wen.mall.controller;

import com.wen.mall.service.CategoryService;
import com.wen.mall.vo.CategoryVo;
import com.wen.mall.vo.ResponseVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping
@ResponseBody
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    @ApiOperation("获取分类列表")
    @GetMapping("/categories")
    public ResponseVo<List<CategoryVo>> findAll() {
        return categoryService.findAll();
    }
}
